import store from '@/store';

function extractContentInParentheses(str) {
  const pattern = str.split('.');

  return pattern[pattern.length - 1];
}

export const DataWrapper = (data) => {
  const actions = store
    .getState()
    .actions.map((a) => extractContentInParentheses(a).toLowerCase());
  return data.filter((value) => actions.includes(value.key.toLowerCase()));
};
